/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package others;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Dingo
 */
public class Console {

    public static String request(String query) {
        String status = "";
        Process p;
        try {
            String s;
            p = Runtime.getRuntime().exec(query);
            BufferedReader out1 = new BufferedReader(new InputStreamReader(p.getInputStream()));
            while ((s = out1.readLine()) != null) {
                status += s;
            }
        } catch (IOException ex) {
            Logger.getLogger(Console.class.getName()).log(Level.SEVERE, null, ex);
        }
       return status;
    }
}
